﻿<phone:PhoneApplicationPage 
    x:Class="GestureTest.GestureMainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d" shell:SystemTray.IsVisible="True" Loaded="GestureMainPage_Loaded" d:DesignHeight="696" d:DesignWidth="480"
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit">
	

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" DataContext="{Binding}">
       
        <!--<Grid.Background>
            <ImageBrush ImageSource="Gestures_Rotate.png" Stretch="UniformToFill" Opacity="1" AlignmentX="Center" />
        </Grid.Background>-->
        
        <Grid.RowDefinitions>
            <RowDefinition Height="90"/>
            <RowDefinition Height="606*"/>
        </Grid.RowDefinitions>

        <!--TitlePanel contains the name of the application and page title-->
        <StackPanel x:Name="TitlePanel" Margin="8,0,0,0" Grid.RowSpan="2" Orientation="Vertical">
           
            <TextBlock x:Name="PageTitle" Text="Assigned gestures" Margin="9,-7,0,0" FontSize="50" Height="72" Foreground="White" Width="452" />
     
        <ListBox x:Name="listBox" FontSize="26" SelectionChanged="contactsList_SelectionChanged"  >

            <ListBox.ItemTemplate>

                <DataTemplate>


                        <Grid>






                            <Border  BorderBrush="White" BorderThickness="2"  Width="400" Margin="10">
                            <StackPanel VerticalAlignment="Center" Orientation="Horizontal" Height="80">

                                <toolkit:ContextMenuService.ContextMenu>
                                    <toolkit:ContextMenu Name="MyContextMenu" >
                                        <toolkit:MenuItem Header="Edit" Click="editgesture_Click"/>
                                        <toolkit:MenuItem Header="Delete" Click="deletegesture_click"/>
                                    </toolkit:ContextMenu>
                                </toolkit:ContextMenuService.ContextMenu>

                                    <!--<StackPanel VerticalAlignment="Center" HorizontalAlignment="Left" Width="">
                                        <Image VerticalAlignment="Center" Name="gesture" Source="{Binding Gesture}" Width="55"/>
                                    </StackPanel>-->
                                
                                    <StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Right" Width="140">
                                        <Image  Name="gesture" Source="{Binding Gesture}" Width="55"/>
                                        <Image  Name="settings" Source="{Binding settings.connectSetting}" Width="55"/>
                                    </StackPanel>

                                    <StackPanel VerticalAlignment="Center" HorizontalAlignment="Right">                                        
                                        <TextBlock VerticalAlignment="Center"  Foreground="White" Text="{Binding DisplayName}" FontSize="32"/>
                                    </StackPanel>

                                    



                                </StackPanel>
                            </Border>

                            <!--<StackPanel Orientation="Horizontal" Height="100" Width="300">

                                    <StackPanel Orientation="Vertical" Height="80" >

                                        <StackPanel Orientation="Horizontal">
                                            <TextBlock  VerticalAlignment="Center"  Foreground="White" Text="{Binding DisplayName}" FontSize="32"/>
                                            <Image Name="gesture" Source="{Binding Gesture}" Stretch="Fill" VerticalAlignment="Bottom" Width="55"/>
                                        </StackPanel>
                                        
                                        <StackPanel Orientation="Horizontal" Height="40">
                                        <Image Name="gesture" Height="48" Source="{Binding Gesture}" Stretch="Fill" VerticalAlignment="Bottom" Width="55"/>                                                                                      
                                            <TextBlock Foreground="White" Text="G:" Width="30"/>
                                            <TextBlock Foreground="White" Text="{Binding Gesture}" Width="50"/>
                                            <TextBlock  Foreground="White" Text="{Binding Action}" Width="50"/>
                                        </StackPanel>

                                    </StackPanel>


                                   
                                </StackPanel>
                            </Border>-->

                        </Grid>
                    </DataTemplate>

            </ListBox.ItemTemplate>
        </ListBox>
        </StackPanel>
        
        <!--<Button Foreground="Blue" Grid.Row="1" HorizontalAlignment="Left" Margin="298,345,0,0" Name="button2" VerticalAlignment="Top" Click="create_click" BorderBrush="Green" RenderTransformOrigin="0.497,0.306" Style="{StaticResource ButtonStyle2}" Width="150" Height="111">
            <Button Style="{StaticResource ButtonStyle2}" Click="create_click" Width="83">
        		<Image Height="75" Source="WP7add2.png" Stretch="Fill" Width="70" VerticalAlignment="Bottom" HorizontalAlignment="Right"/>
        	</Button>
        </Button>
        <RadioButton Foreground="Blue" Grid.Row="1" Height="111" Margin="8,345,337,0" Name="callRadioButton" VerticalAlignment="Top" IsChecked="True" Background="#BF4D8593">
        	<Image Height="75" Source="WP7call2.png" Stretch="Fill" Width="70" VerticalAlignment="Bottom" HorizontalAlignment="Right"/>
        </RadioButton>

        <RadioButton Foreground="Blue" Grid.Row="1" Height="111" HorizontalAlignment="Left" Margin="149,345,0,0" Name="msgRadioButton" VerticalAlignment="Top" Width="147" Background="#BF4D8593" >
        	<Image Height="75" Source="WP7msg2.png" Stretch="Fill" Width="70" VerticalAlignment="Bottom" HorizontalAlignment="Right"/>
        </RadioButton>-->
      
        <!--ContentPanel - place additional content here-->
    </Grid>
 
    <!--Sample code showing usage of ApplicationBar-->
    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
            <!--<shell:ApplicationBarIconButton IconUri="appbar.phone.rest.png" Text="Call" Click="barCall_Click" />
            <shell:ApplicationBarIconButton IconUri="appbar.send.text.rest.png" Text="Message" Click="barMessage_Click"/> -->
            
            <!--<shell:ApplicationBarIconButton IconUri="appbar.manage.rest.png" Text="Settings" Click="barSettings_Click"/>-->
            <shell:ApplicationBarIconButton IconUri="appbar.add.rest.png" Text="Add" Click="barAdd_Click"/>
            <!--<shell:ApplicationBar.MenuItems>
                <shell:ApplicationBarMenuItem Text="MenuItem 1"/>
                <shell:ApplicationBarMenuItem Text="MenuItem 2"/>
            </shell:ApplicationBar.MenuItems>-->
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>
    
    
    

</phone:PhoneApplicationPage>
